


Namespace Producto
Public Class Catalogo



 Public Function Combo(ByVal vTodos As Boolean, Optional ByVal vmensaje As String = "Todos") As Entity.Producto.CatalogoCol
dim objCol as  New entity.Producto.CatalogoCol
dim obj as  New Data.Producto.Catalogo
objCol = obj.Listar("", _
		-1, _
		"", _
		"", _
		"", _
		-1, _
		-1, _
		"", _
		-1, _
		-1, _
		"", _
		-1, _
		-1)
 If vTodos Then
Dim ent As New Entity.Producto.Catalogo( _ 
		-1, _
		vmensaje , _
		"", _
		"", _
		-1, _
		-1, _
		"", _
		-1, _
		-1, _
		"", _
		-1, _
		-1)
objCol.AddPrimero(ent)
End If
Return objCol
End Function


'***************************


public Function Listar(CatalogoId as integer) as Entity.Producto.Catalogo

dim objEnt as  New entity.Producto.Catalogo
dim obj as  New Data.Producto.Catalogo
return obj.Listar(CatalogoId)

End Function


'***************************



public Function Listar( _
		CatalogoId as Integer, _
		Codigo as String, _
		Nombre as String, _
		Concentracion as String, _
		FormaID as Integer, _
		FormaSimpleId as Integer, _
		Presentacion as String, _
		Fracciones as Integer, _
		FechaRegistroSanitario as Integer, _
		RegistroSanitario as String, _
		MarcaId as Integer, _
		Generico as Integer) _
as  Entity.Producto.CatalogoCol

dim objCol as  New entity.Producto.CatalogoCol
dim obj as  New Data.Producto.Catalogo
return obj.listar("", _
		CatalogoId, _
		Codigo, _
		Nombre, _
		Concentracion, _
		FormaID, _
		FormaSimpleId, _
		Presentacion, _
		Fracciones, _
		FechaRegistroSanitario, _
		RegistroSanitario, _
		MarcaId, _
		Generico)

End Function


'***************************


public Function Grabar( _
		CatalogoId as Integer, _
		Codigo as String, _
		Nombre as String, _
		Concentracion as String, _
		FormaID as Integer, _
		FormaSimpleId as Integer, _
		Presentacion as String, _
		Fracciones as Integer, _
		FechaRegistroSanitario as Integer, _
		RegistroSanitario as String, _
		MarcaId as Integer, _
		Generico as Integer, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Producto.Catalogo
 if CatalogoId=-1 then 
_codigo= obj.insert( "", _
		CatalogoId , _
		Codigo , _
		Nombre , _
		Concentracion , _
		FormaID , _
		FormaSimpleId , _
		Presentacion , _
		Fracciones , _
		FechaRegistroSanitario , _
		RegistroSanitario , _
		MarcaId , _
		Generico , _
 vUSuario )
else
_codigo= obj.update( "", _
		CatalogoId , _
		Codigo , _
		Nombre , _
		Concentracion , _
		FormaID , _
		FormaSimpleId , _
		Presentacion , _
		Fracciones , _
		FechaRegistroSanitario , _
		RegistroSanitario , _
		MarcaId , _
		Generico , _
 vUSuario )
end if 
return _codigo

End Function


'***************************


public Function Insertar( _
		CatalogoId as Integer, _
		Codigo as String, _
		Nombre as String, _
		Concentracion as String, _
		FormaID as Integer, _
		FormaSimpleId as Integer, _
		Presentacion as String, _
		Fracciones as Integer, _
		FechaRegistroSanitario as Integer, _
		RegistroSanitario as String, _
		MarcaId as Integer, _
		Generico as Integer, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Producto.Catalogo
_codigo= obj.insert( "", _
		CatalogoId, _
		Codigo, _
		Nombre, _
		Concentracion, _
		FormaID, _
		FormaSimpleId, _
		Presentacion, _
		Fracciones, _
		FechaRegistroSanitario, _
		RegistroSanitario, _
		MarcaId, _
		Generico, _
 vUSuario )
return _codigo

End Function


'***************************


public Function Updatear( _
		CatalogoId as Integer, _
		Codigo as String, _
		Nombre as String, _
		Concentracion as String, _
		FormaID as Integer, _
		FormaSimpleId as Integer, _
		Presentacion as String, _
		Fracciones as Integer, _
		FechaRegistroSanitario as Integer, _
		RegistroSanitario as String, _
		MarcaId as Integer, _
		Generico as Integer, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Producto.Catalogo
_codigo= obj.Update( "", _
		CatalogoId , _
		Codigo , _
		Nombre , _
		Concentracion , _
		FormaID , _
		FormaSimpleId , _
		Presentacion , _
		Fracciones , _
		FechaRegistroSanitario , _
		RegistroSanitario , _
		MarcaId , _
		Generico , _
 vUSuario )
return _codigo

End Function


'***************************


public Function ELiminar(  CatalogoId as integer,vusuario as integer ,optional vopcion as string="Delete") as integer
dim _codigo as integer =-1
dim obj as  New Data.Producto.Catalogo
_codigo= obj.Eliminar( "vopcion", CatalogoId ,vusuario)
return _codigo

End Function

End Class



end namespace

